<div class="layui-side layui-bg-black">
	<div class="layui-side-scroll">
		<#include "/apps/business/workorders/include/left.html">
	</div>
</div>
<div class="layui-body">
	<div class="layui-side-scroll">
		<div class="row">
			<div class="col-lg-12">
				<h1 class="site-h1 ukefu-tab" style="border-top:1px solid #e6e6e6;height:26px;position: relative;">
					<span class="ukefu-bt">
						<i class="kfont ukewo-btn" style="font-size:20px;">&#xe607;</i>
						<div class="ukefu-bt-text">
							<div class="ukefu-bt-text-title">
								我的工单（${workOrdersList.totalElements}）
							</div>
						</div>
					</span>
					<div class="ukefu-bt-text-content" style="position: absolute;right: 5px;top: 0px;">
						<form class="layui-form" name="search" action="/apps/workorders/myorders.html" method="get" style="width:99%;overflow:hidden;">
							<div class="layui-form-item" style="width:100%;">
								<div class="layui-inline" style="width:100%;">
									<div class="layui-input-inline" style="width:100%;">
										<input type="text" name="q" value="${q!''}" style="height: 30px;line-height: 30px;margin-top: 4px;border: 1px solid ${systemConfig.styleColor!'#32c24d;'};" placeholder="请输入查询条件" autocomplete="off" class="layui-input">
										<i class="layui-icon" onclick="search.submit()" style="position: absolute;cursor: pointer;right: 3px;top: 4px;font-size: 20px;color:${systemConfig.styleColor!'#32c24d;'};"></i>
									</div>
								</div>
							</div>
						</form>
					</div>
				</h1>
				<table class="layui-table" lay-skin="line" style="width:100%;">
					<thead>
						<tr class="design-sortable-tr">
							<th style="text-align:right;">编号</th>
							<th style="width:40%;">标题</th>
							<th>联系人</th>
							<th>发起人</th>
							<th>优先级</th>
							<th>状态</th>
							<th>处理人</th>
						</tr>
					</thead>
					<tbody>
						<#if workOrdersList?? && workOrdersList.content??>
						<#list workOrdersList.content as workOrders>
						<tr class="tdHasContorllor design-dropable-td">
							<td class="uk-workorders-td first_td_head">
								<div class="ukefu-workorders-number" id="fav_${workOrders.id!''}" title="创建时间：${workOrders.createtime?string("yyyy-MM-dd HH:mm:ss")}">
									<#include "/apps/business/workorders/orderno.html">
								</div>
							</td>
							<td>
								<a href="/apps/workorders/myorders/detail.html?id=${workOrders.id!''}" title="${workOrders.title!''}">
								<#if workOrders.title?length gt 30>
									${workOrders.title[0..30]?no_esc}...
								<#else>
									${(workOrders.title!'')?no_esc}
								</#if>
								<#if workOrders.anonymous>
									<i class="kfont" style="font-size:14px;" title="附件">&#xe61e;</i>
								</#if>
								</a> 
							</td>
							<td>
								<#if workOrders.contacts??>
								${workOrders.contacts.name!''} 
								</#if>
							</td>
							<td>
								<#if workOrders.user??>
								${workOrders.user.uname!''} 
								</#if>
							</td>
							<td>
								<#list uKeFuDic["com.dic.workorders.priority"] as workOrdersStatus>
									<#if workOrdersStatus.id == workOrders.priority>
										<i class="kfont" <#if workOrdersStatus.iconskin?? && workOrdersStatus.iconskin != "">style="color:${workOrdersStatus.iconskin}"</#if> title="优先级：${workOrdersStatus.name!''}">&#xe82d;</i>
									</#if>
								</#list>
							</td>
							<td>
								<#list uKeFuDic['com.dic.workorders.status'] as workOrdersStatus>
								<#if workOrdersStatus.id == workOrders.status || workOrdersStatus.code == workOrders.status>
								<small class="ukefu-label" <#if workOrdersStatus.iconskin?? && workOrdersStatus.iconskin != "">style="background-color:${workOrdersStatus.iconskin}"</#if>>${workOrdersStatus.name!''}</small>
								</#if>
								</#list>
							</td>
							<td>
								<#if workOrders.current??>
								${workOrders.current.username!''} （${workOrders.current.uname!''}）
								</#if>
							</td>
						</tr>
						</#list>
						<#else>
							<tr>
								<td colspan="20" style="height:400px;">
									<div class="ukefu-empty">
										<i class="layui-icon">&#xe63a;</i>
										<div style="">还没有工单信息</div>
									</div>
								</td>
							</tr>
						</#if>
					</tbody>
				</table>

			</div>
		</div>
		<div class="row" style="padding:5px;">
			<div class="col-lg-12" id="page" style="text-align:center;"></div>
		</div>
	</div>
</div>
<script language="javascript"> 		
	layui.use('form', function(){
		var form = layui.form;
	});
	layui.use(['laypage', 'layer'], function(){
		  var laypage = layui.laypage
		  ,layer = layui.layer;
		  
		  laypage.render({
				elem: 'page'
				,pages: <#if workOrdersList??>${workOrdersList.totalPages}<#else>0</#if> //总页数
				,curr:<#if workOrdersList??>${workOrdersList.number+1}<#else>0</#if>
				,groups: 5 //连续显示分页数
				,jump:function(data , first){
					if(!first){
						location.href = "/apps/workorders/myorders.html?p="+data.curr ;
					}
				}
		   });
		});
			
</script>